package com.example.javabasic.suanfa.jiandan.二叉树验证;

import java.util.ArrayList;
import java.util.List;

/**
 * @description
 * @Author Lin FuYuan
 * @date 2021/6/9
 */
public class One {


    // Definition for a binary tree node
    public class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode() {
        }

        TreeNode(int val) {
            this.val = val;
        }

        TreeNode(int val, TreeNode left, TreeNode right) {
            this.val = val;
            this.left = left;
            this.right = right;
        }
    }
    private  Integer num;

    public boolean isValidBST(TreeNode root) {
        if (root == null) {
            return true;
        }
        isValidBST(root.left);
        if(num== null){

        }

        return false;
    }

    public boolean test(TreeNode root ,int max ,int min){
        if(root == null){
            return true;
        }
        if(root.val<min || root.val> max ){
            return false;
        }
        return test(root.left,root.val,min) && test(root.right,max,root.val);

    }

    public void bianli(TreeNode node){

        bianli(node.left);
        bianli(node.right);
    }
}
